package com.mxpio.erp.common.workshop.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mxpio.erp.common.inventory.entity.Warehouse;
import com.mxpioframework.jpa.annotation.DictAble;
import com.mxpioframework.security.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.persistence.Column;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author : 吴盼盼
 * @Datetime : 2022/10/28 23:20
 * @Desc :
 * @Modor :  Modifytime:
 * @modDesc :
 */
@Data
public class MoPickingNoticeExportVO implements DictAble, Serializable {

	private static final long serialVersionUID = 1L;

	@Schema(description = "通知单号")
    private String noticeNo;

    @Schema(description = "单据状态")
    @Dict(dicCode = "ERP_INV_NOTICE_STATUS")
    private String noticeStatus;

/*
    @Schema(description = "出入类型")
    private String accessType;

    @Schema(description = "通知类型")
    private String typeCode;
*/

    @Schema(description = "通知单类别")
    //@Dict(dicCode = "ERP_WORKSHOP_PICKING_TYPE")
    @Dict(dicCode = "ERP_INV_WO_TYPE")//应该跟仓库类型保持一致
    private String pickingType;

    @Schema(description = "业务单号")
    private String bizOrderNo;

    @Schema(description = "仓库")
    @Dict(dicCode = "whCode", dicEntity = Warehouse.class, dicText = "whName")
    private String whCode;

    @Schema(description = "单据日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date noticeDate;

    @Schema(description = "行号")
    private String lineNo;

    @Schema(description = "来源单号")
    private String originBizNo;

    @Schema(description = "来源单行号")
    private String originBizLineNo;

  /*  @Column(name = "SORT_")
    @Schema(description = "顺序号")
    private String sort;*/

    @Schema(description = "物料编码")
    private String itemCode;

    @Schema(description = "物料名称")
    private String itemName ;

    @Schema(description = "规格型号")
    private String itemSpec;

    @Schema(description = "单位编号")
    @Dict(dicCode="ERP_TECH_UNIT_CODE")
    private String unitCode;

    @Schema(description = "批次号")
    private String lotNo;

    @Schema(description = "数量")
    private BigDecimal quantity;


    @Column(name = "MEMO_")
    @Schema(description = "备注")
    private String memo;

    private Map<String, String> textMap;
    @Override
    public String putText(String key, String value) {
        if (textMap == null) {
            textMap = new HashMap<>();
        }
        return textMap.put(key, value);
    }
}
